package com.ts.api.module.match.plan.internal.distribute.strategy;

import com.ts.api.module.api.convert.core.http.client.ApiHttpMessage;
import com.ts.api.module.api.convert.platform.handler.ApiPlatformPhoneMd5ConvertHandler;
import com.ts.api.module.match.plan.internal.distribute.model.PlanDistribute;
import com.ts.api.module.match.plan.internal.distribute.model.PlanDistributeField;
import com.ts.api.module.match.plan.internal.distribute.model.PlanDistributePost;
import com.ts.api.module.match.plan.internal.distribute.model.PlanDistributeResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *  API渠道-特殊计划分发
 *
 *  @author Pan
 */
@Service
public class ApiSpecialPhoneMd5Distribute implements PlanDistributeStrategy<ApiPlatformPhoneMd5ConvertHandler> {

    @Autowired
    private ApiPlatformPhoneMd5Distribute apiPlatformPhoneMd5Distribute;

    @Override
    public PlanDistributeResult preValidate(PlanDistribute planDistribute) {
        return apiPlatformPhoneMd5Distribute.preValidate(planDistribute);
    }

    @Override
    public PlanDistributeResult distribute(PlanDistribute planDistribute) {
        return apiPlatformPhoneMd5Distribute.distribute(planDistribute);
    }

    @Override
    public PlanDistributeField parseResponse(PlanDistribute planDistribute, ApiHttpMessage apiHttpMessage, ApiPlatformPhoneMd5ConvertHandler handler) throws Exception {
        return apiPlatformPhoneMd5Distribute.parseResponse(planDistribute, apiHttpMessage, handler);
    }

    @Override
    public PlanDistributeResult post(PlanDistributePost planDistributePost) {
        return apiPlatformPhoneMd5Distribute.post(planDistributePost);
    }
}
